#include <iostream>

using namespace std;

#include "hge\hge.h"
#include "hge\hgesprite.h"
#include "hge\hgeresource.h"
#include "hge\hgevector.h"
#include "hge\hgefont.h"

HGE* hge;
hgeFont* fnt;
hgeResourceManager hrm;

bool FrameFunc()
{
	static bool lstatus = false;
	float dt = hge->Timer_GetDelta();
	float ctime = hge->Timer_GetTime();
	return false;
}

bool RenderFunc()
{
	hge->Gfx_BeginScene();
	hge->Gfx_Clear(0);
	fnt->printf(5, 5, HGETEXT_LEFT, "dt: %f", hge->Timer_GetDelta());
	hge->Gfx_EndScene();
	return false;
}

int main()
{
	hge = hgeCreate(HGE_VERSION);

	hge->System_SetState(HGE_LOGFILE, "bulletTest.log");
	hge->System_SetState(HGE_FRAMEFUNC, FrameFunc);
	hge->System_SetState(HGE_RENDERFUNC, RenderFunc);
	hge->System_SetState(HGE_TITLE, "A.I.R barage");
	hge->System_SetState(HGE_WINDOWED, true);
	hge->System_SetState(HGE_SCREENWIDTH, 800);
	hge->System_SetState(HGE_SCREENHEIGHT, 600);
	hge->System_SetState(HGE_SCREENBPP, 32);
	hge->System_SetState(HGE_HIDEMOUSE, false);
	hge->System_SetState(HGE_SHOWSPLASH, false);
	hge->System_SetState(HGE_FPS, 60);

	if(hge->System_Initiate())
	{
		hrm.ChangeScript("aeria.res");
		hrm.Precache();
		fnt = hrm.GetFont("fnt.original");
		if (fnt) {
			hge->System_Start();
		}
		hrm.Purge();
	}
	hge->System_Shutdown();
	hge->Release();
	return 0;
}
